// https://www.luogu.com.cn/problem/P5740

#include <iostream>
#include <vector>
using namespace std;

typedef struct {
    char name[10];
    int scores[3];
} Student;

int main() {
    int n;
    Student students[1001];
    scanf("%d",&n);
    int max = 0;
    int maxIndex = 0;
    for (int i = 0; i < n; i++) {
        scanf("%s %d %d %d", students[i].name, &students[i].scores[0], &students[i].scores[1], &students[i].scores[2]);
        int sum = students[i].scores[0] + students[i].scores[1] + students[i].scores[2];
        if (sum > max) {
            max = sum;
            maxIndex = i;
        }
    }
    printf("%s %d %d %d", students[maxIndex].name, students[maxIndex].scores[0], students[maxIndex].scores[1], students[maxIndex].scores[2]);
    return 0;
}